package GUI;

import javax.swing.table.DefaultTableModel;
import javax.swing.*;
import java.awt.*;


/**
 * This class creates instance of TardinessReportGuiOutput 	
 * to display when needed 
 * @author Natali
 *
 */
public class TardinessReportGuiOutput extends JPanel {
	
	private static final long serialVersionUID = 1L;
	private JTable table;
	private JButton buttonCancel;

	/**
	 * the constructor that  initialize the TardinessReportGuiOutput
	 */
	public TardinessReportGuiOutput() {
		setLayout(null);
		
		table = new JTable();
		table.setModel(new DefaultTableModel(
			new Object[][] {
				{null,"total days", "frequency", "standard deviation", "median"},
				{"number of late", null, null, null, null},
				{"late duration", null, null, null, null},
				
			},
			new String[] {
				"total days", "New column", "New column", "New column", "New column"
			}
		));
		table.getColumnModel().getColumn(0).setPreferredWidth(80);
		table.setBounds(10, 104, 608, 48);
		add(table);
		
		JLabel lblTardinessReport = new JLabel("Tardiness report");
		lblTardinessReport.setForeground(Color.BLUE);
		lblTardinessReport.setFont(new Font("Arial", Font.BOLD, 17));
		lblTardinessReport.setBounds(236, 45, 169, 29);
		add(lblTardinessReport);
		
		JButton buttonCancel = new JButton("cancel");
		buttonCancel.setFont(new Font("Tahoma", Font.BOLD, 13));
		buttonCancel.setBounds(10, 350, 124, 33);
		add(buttonCancel);
	}

	/**
	 * 
	 * @return JTable 
	 */
	public JTable getTable() {
		return table;
	}
	/**
	 * 
	 * @param table that set the table for display
	 */
	public void setTable(JTable table) {
		this.table = table;
	}
	/**
	 * 
	 * @return the cancel button
	 */
	public JButton getCancelButton(){
		return buttonCancel;
	}
}
